<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="p" uri="http://primefaces.prime.com.tr/ui"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Organizer Project</title>
            <p:resources />
        </head>
        <body>
            <p:growl id="aviso" />
            <p:panel header="Cadastrar Compromisso" style="width: 500px"> 
                
                <h:form>
                    <h:panelGrid columns="2">
                       <h:outputLabel value="Descrição"/>
                       <h:inputText value="#{compromissoManagedBean.compromisso.descricao}" id="descricao" required="true" requiredMessage="Por favor, informe a DESCRIÇÃO."/>
                       <h:outputLabel value="Data/hora Inicial"/> 
                       <p:calendar value="#{compromissoManagedBean.compromisso.dataInicio}" navigator="true" pattern="dd/MM/yyyy XX:XX" id="dataInicio" required="true" requiredMessage="Por favor, informe a DATA INICIAL." converterMessage="Formato da Data/hora Inicial: dd/MM/yyyy HH:mm">                       
                           <f:convertDateTime pattern="dd/MM/yyyy HH:mm" />
                       </p:calendar>
                       <h:outputLabel value="Data/hora Final"/>
                       <p:calendar value="#{compromissoManagedBean.compromisso.dataFim}" navigator="true" pattern="dd/MM/yyyy XX:XX" id="dataFinal" required="true" requiredMessage="Por favor, informe a DATA FINAL." converterMessage="Formato da Data/hora Final: dd/MM/yyyy HH:mm">                       
                           <f:convertDateTime pattern="dd/MM/yyyy HH:mm" />
                       </p:calendar>
                    </h:panelGrid>
                    <p:commandButton value="Salvar" action="#{compromissoManagedBean.cadastrarCompromisso}" update="aviso" ajax="false"/>
                </h:form>
            </p:panel>
        </body>
    </html>
</f:view>
